using Orchard.ContentManagement.MetaData;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;
using MembersOnly.Models;

namespace MembersOnly
{
    public class Migrations : DataMigrationImpl {

        public int Create() {
            // Creating table MembersOnlyRecord
            SchemaBuilder.CreateTable("MembersOnlyRecord", table => table.ContentPartRecord());

            ContentDefinitionManager.AlterPartDefinition(typeof(MembersOnlyPart).Name, cfg => cfg.Attachable());

            return 1;
        }
    }
}